package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacTestWorkFlow;
import com.ysd.lis.request.lab.ChangeWorkFlowParam;
import com.ysd.lis.service.bac.BacTestWorkFlowService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 微生物检验应用流程方案 前端控制器
 * </p>
 *
 * @author cfz
 * @since 2024-04-11
 */
@RestController
@RequestMapping("/api/bac/bac-test-work-flow")
public class BacTestWorkFlowController extends BaseController {
    @Autowired
    BacTestWorkFlowService bacTestWorkFlowService;

    @ApiOperation("查询")
    @GetMapping("/findBacTestWorkFlowList")
    public Result findBacTestWorkFlowList(BacTestWorkFlow bacTestWorkFlow) {
        return bacTestWorkFlowService.findBacTestWorkFlowList(bacTestWorkFlow);
    }

    @ApiOperation("查询")
    @GetMapping("/findBacTestWorkFlowListByReqNo")
    public Result findBacTestWorkFlowListByReqNo(BacTestWorkFlow bacTestWorkFlow) {
        return bacTestWorkFlowService.findBacTestWorkFlowListByReqNo(bacTestWorkFlow);
    }

    @ApiOperation("增加")
    @PostMapping("/addBacTestWorkFlow")
    public Result addBacTestWorkFlow(@RequestBody BacTestWorkFlow bacTestWorkFlow) {
        return bacTestWorkFlowService.addBacTestWorkFlow(bacTestWorkFlow);
    }

    @ApiOperation("删除")
    @PostMapping("/deleteBacTestWorkFlow")
    public Result deleteBacTestWorkFlow(@RequestBody BacTestWorkFlow bacTestWorkFlow) {
        return bacTestWorkFlowService.deleteBacTestWorkFlow(bacTestWorkFlow);
    }

    @ApiOperation("修改")
    @PostMapping("/updateBacTestWorkFlow")
    public Result updateBacTestWorkFlow(@RequestBody BacTestWorkFlow bacTestWorkFlow) {
        return bacTestWorkFlowService.updateBacTestWorkFlow(bacTestWorkFlow);
    }

    @ApiOperation("切换方案")
    @PostMapping("/changeBacTestWorkFlow")
    public Result changeBacTestWorkFlow(@RequestBody BacTestWorkFlow bacTestWorkFlow) {
        return bacTestWorkFlowService.changeBacTestWorkFlow(bacTestWorkFlow);
    }

    @ApiOperation("切换方案V2")
    @PostMapping("/changeBacTestWorkFlowV2")
    public Result changeBacTestWorkFlowV2(@RequestBody ChangeWorkFlowParam input) {
        return bacTestWorkFlowService.changeBacTestWorkFlowV2(input);
    }

    @ApiOperation("切换方案查询所有方案")
    @GetMapping("/findAllWorkFlowWithCurrentUse")
    public Result findAllWorkFlowWithCurrentUse(BacTestWorkFlow bacTestWorkFlow) {
        return bacTestWorkFlowService.findAllWorkFlowWithCurrentUse(bacTestWorkFlow);
    }
}
